import { warn } from "cc";

/**
 * cocos creator 强化学习能力
 */
export class CCCRLCapabilities {

    /**
     * 是否支持强化学习
     */
    baseRLCapabilities: boolean;

    /**
     * 拼接PNG观察能力
     */
    concatenatedPngObservations: boolean;
    /**
     * 压缩通道映射
     */
    compressedChannelMapping: boolean;

    /**
     * 混合操作
     */
    hybridActions: boolean;

    /**
     * 变长观察
     */
    variableLengthObservation: boolean;

    /**
     * 多智能体组
     */
    multiAgentGroups: boolean;

    constructor(
        baseRLCapabilities: boolean = true,
        concatenatedPngObservations: boolean = true,
        compressedChannelMapping: boolean = true,
        hybridActions: boolean = true,
        variableLengthObservation: boolean = true,
        multiAgentGroups: boolean = true
    ) {
        this.baseRLCapabilities = baseRLCapabilities;
        this.concatenatedPngObservations = concatenatedPngObservations;
        this.compressedChannelMapping = compressedChannelMapping;
        this.hybridActions = hybridActions;
        this.variableLengthObservation = variableLengthObservation;
        this.multiAgentGroups = multiAgentGroups;
    }

    warnOnPythonMissingBaseRLCapabilities() {
        if(this.baseRLCapabilities){
            return false;
        }
        warn("cocos creator 强化学习能力未启用，请检查python环境是否支持。");
    }
}